<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .a{
        position: relative;
        top:320px;
        left: 40%;
    }
    .teatarea{
        width: 300px;
        height: 100px;
    }
    .account,.password{
        height: 25px;
    }
</style>
<body text="white" background="img/img1.jpg">
    <div class="a">
        <form action="xxx" onsubmit="return check()">
            <p>帐号：<input class="account"id="a"name="a" type="text" placeholder="请输入帐号..." ></p>
            <p>密码：<input class="password"name="b" type="password"></p>
            <p>性别：
                <input type="radio" name="sex" checked ="checked">男
                <input type="radio" name="sex">女
            </p>
            <p>学历：
                <input type="radio" name="school" checked ="checked">本科
                <input type="radio" name="school">专科
            </p>
            <p>自我介绍：
                <textarea id="text" class="teatarea" placeholder="可以从兴趣爱好等方面介绍自己" style="vertical-align:top"></textarea>
            </p>
            <p>
                <input type="reset"  value="清空">
                <input type="submit" value="提交">
                <input type="button" value="取消">
            </p>
        </form>
        <script>
              function check(){
                var name = document.getElementById("a").value;
                if(name ==""){
                    alert("密码不能为空! ");
                    return false;
                }else if(name != "admin"){
                    alert("密码错误，请重新输入")
                    return false;
                }else{
                    var txt=document.getElementById("text").value;
                    alert(txt);
                }
                return true;
            }
        </script>
    </div>
</body>
</html>